package net.wwang.blog.dao;

import net.wwang.blog.pojo.bo.UserAndRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserRoleDao extends JpaRepository<UserAndRole,String> , JpaSpecificationExecutor<UserAndRole> {
    @Query(nativeQuery=true,value="select `role_id` from `user_role` where `user_id` = ?1")
    List<String> findRoleIdsByUserId(String userId);

}
